package org.reliablesource.jdt.viewers;

import org.eclipse.jface.viewers.TableTreeViewer;
import org.eclipse.swt.widgets.Composite;
import org.reliablesource.client.ui.viewers.ElementTableViewer;
import org.reliablesource.client.ui.viewers.ReliableElementContentProvider;
import org.reliablesource.jdt.model.ISourceElementInfo;

/**
 *
 *  JavaElementInfoTableViewer.java<br>
 *  Copyright (c) 2007, Reliable Source, Inc. All Rights Reserved<br><br>
 *
 *	Created on: Apr 19, 2007 <br><br>
 *  @author Dennis Park 
 *<a href="mailto:dennis.park@gmail.com">dennis.park@gmail.com</a>
 *
 * @since 1.0.0
 */
public class JavaElementInfoTableViewer extends ElementTableViewer {
	public JavaElementInfoTableViewer(){
		super();
	}

	@Override
	public String[] getColumns() {
		return ISourceElementInfo.PROPERTIES;
	}
	
	/* (non-Javadoc)
	 * @see org.reliablesource.client.ui.viewers.ReliableViewer#setInput(java.lang.Object)
	 */
	@Override
	public void setInput(Object _input) {
		contentViewer.setInput(_input);
		resizeAndLayout();
	}
	
	/* (non-Javadoc)
	 * @see org.reliablesource.client.ui.viewers.ElementTableViewer#createViewerControl(org.eclipse.swt.widgets.Composite)
	 */
	@Override
	public void createViewerControl(Composite _parent) {
		super.createViewerControl(_parent);
		((TableTreeViewer) contentViewer)
				.setContentProvider(new ReliableElementContentProvider());
		((TableTreeViewer) contentViewer)
				.setLabelProvider(new JavaElementTableLabelProvider());
		addChild(contentViewer);
		
		contentViewer.setContentProvider(new ReliableElementContentProvider());
		contentViewer.setLabelProvider(new JavaElementTableLabelProvider());
		addChild(contentViewer);
	}
	
}
